package com.app.micaihu.custom.view.scrollview;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.*;

/**
 * Created by Guo on 2017/6/15.
 */

public class HorizontalScrollViewWithListener extends android.widget.HorizontalScrollView {
    public HorizontalScrollViewWithListener(Context context) {
        super(context);
    }

    public HorizontalScrollViewWithListener(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public HorizontalScrollViewWithListener(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }
    private ScrollViewListener scrollViewListener = null;



    public void setScrollViewListener(ScrollViewListener scrollViewListener) {
        this.scrollViewListener = scrollViewListener;
    }

    @Override
    protected void onScrollChanged(int x, int y, int oldx, int oldy) {
        super.onScrollChanged(x, y, oldx, oldy);
        if (scrollViewListener != null) {
            scrollViewListener.onScrollChanged(this, x, y, oldx, oldy);
        }
    }

}
